import antlr.Token;
import antlr.collections.AST;
import antlr.collections.ASTEnumeration;

public abstract class AbstractComponent implements IComponent, AST
{
	protected IComponent leftChild ;
	protected IComponent rightChild ;
	public AbstractComponent(IComponent leftChild, IComponent rightChild)
	{
		this.leftChild = leftChild ;
		this.rightChild = rightChild ;
	}
	public String toDokuWiki()
	{
		return toDokuWiki("") ;
	}
	public String toMediaWiki()
	{
		return toMediaWiki("") ;
	}
	@Override
	public String toText2tags()
	{
		return toText2tags("") ;
	}
	protected String toText2tags(String separator)
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		if(leftChild == null)
		{
			if(rightChild != null)
				return rightChild.toText2tags() ;
			return "" ;
		}
		stringBuilder.append(leftChild.toText2tags()) ;
		if(rightChild != null)
		{
			stringBuilder.append(separator) ;
			stringBuilder.append(rightChild.toText2tags()) ;
		}
		return stringBuilder.toString() ;
	}
	
	protected String toDokuWiki(String separator)
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		if(leftChild == null)
		{
			if(rightChild != null)
				return rightChild.toDokuWiki() ;
			return "" ;
		}
		stringBuilder.append(leftChild.toDokuWiki()) ;
		if(rightChild != null)
		{
			stringBuilder.append(separator) ;
			stringBuilder.append(rightChild.toDokuWiki()) ;
		}
		return stringBuilder.toString() ;
	}
	protected String toMediaWiki(String separator)
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		stringBuilder.append(leftChild.toMediaWiki()) ;
		if(rightChild != null)
		{
			stringBuilder.append(separator) ;
			stringBuilder.append(rightChild.toMediaWiki()) ;
		}
		return stringBuilder.toString() ;
	}
	
	
	@Override
	public void addChild(AST arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public boolean equals(AST arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public boolean equalsList(AST arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public boolean equalsListPartial(AST arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public boolean equalsTree(AST arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public boolean equalsTreePartial(AST arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public ASTEnumeration findAll(AST arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public ASTEnumeration findAllPartial(AST arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int getColumn() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public AST getFirstChild() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int getLine() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public AST getNextSibling() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int getNumberOfChildren() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public String getText() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int getType() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public void initialize(AST arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void initialize(Token arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void initialize(int arg0, String arg1) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setFirstChild(AST arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setNextSibling(AST arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setText(String arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setType(int arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public String toStringList() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String toStringTree() {
		// TODO Auto-generated method stub
		return null;
	}
}
